package org.achao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.achao.pojo.MybatisPlusDemo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author achao
 * @description 针对表【mybatis_plus_demo】的数据库操作Mapper
 * @createDate 2023-09-23 16:29:10
 * @Entity org.achao.pojo.MybatisPlusDemo
 */
@Mapper
public interface MybatisPlusDemoMapper extends BaseMapper<MybatisPlusDemo> {

    @Insert("insert into mybatis_plus_demo(id,family_key,family_value)values (#{id},#{familyKey},#{familyValue})")
    Integer myInsert(MybatisPlusDemo mybatisPlusDemo);

    @Select("select * from mybatis_plus_demo")
    List<MybatisPlusDemo> mySelectAll();

    @Update("update mybatis_plus_demo set family_key = #{familyKey} and family_value = #{familyValue} where id = #{id}")
    Integer myUpdate(MybatisPlusDemo mybatisPlusDemo);

    @Delete("delete from mybatis_plus_demo")
    void deleteAll();

}




